package com.example.sms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.sms.entity.Course;
import com.example.sms.entity.Student;
import com.example.sms.entity.dto.RegisterDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper extends BaseMapper<Student> {

    @Select("select * from student where username = #{username} and password = #{password}")
    Student selectByUsernameAndPassword(String username, String password);
    @Insert("insert into student(username,password,email,phone,gender,name) " +
            "values" +
            "(#{username},#{password},#{email},#{phone},#{gender},#{name})")
    Integer insert(RegisterDTO registerDTO);
    @Select("select name from student")
    Object ListAllStudent();

    @Select("select * from student")
    List<Student> SelectAllStudent();

    List<Course> listSelfCourse(Integer id);
}
